home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / lfsrecov / lfsrecov.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-17  |  3.9 KB  |  107 lines

  1. /*
  2.  * lfsrecov.h --
  3.  *
  4.  *    Declarations of global data structures and routines of the
  5.  *    lfsrecov program.
  6.  *
  7.  * Copyright 1991 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that this copyright
  11.  * notice appears in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * $Header: /sprite/lib/forms/RCS/proto.h,v 1.7 91/02/09 13:24:52 ouster Exp $ SPRITE (Berkeley)
  17.  */
  18.  
  19. #ifndef _LFSRECOV
  20. #define _LFSRECOV
  21.  
  22. /* constants */
  23.  
  24. /* data structures */
  25.  
  26. /*
  27.  * Recovery is implemented as a two pass operation on the
  28.  * log tail. enum Pass defines which pass is active.
  29.  */
  30. enum Pass { PASS1, PASS2};
  31.  
  32. /*
  33.  * For a operation from the directory log, the operands 
  34.  * can be in one of three states:
  35.  *    UNKNOWN - The operand is between the START and END record. The
  36.  *          change may or may not have made it out.
  37.  *     FORWARD - The operand is after the END record in the log. Change
  38.  *          did make it out. 
  39.  *    BACKWARD - The operand is before the END record in the log. Change
  40.  *           didn't make it out.
  41.  */
  42. enum LogStatus { UNKNOWN, FORWARD, BACKWARD};
  43.  
  44. /*
  45.  * Stats for program.
  46.  */
  47.  
  48. typedef struct Stats {
  49.     int       crashTime;    /* Time last checkpoint. */
  50.     int       timestamp;    /* Timestamp of last checkpoint. */
  51.     struct timeval    startTimeOfDay; /* Start time of program. */
  52.     struct timeval    startPass1TimeOfDay; /* Start time of pass1. */
  53.     struct timeval    startPass2TimeOfDay; /* Start time of pass2. */
  54.     struct timeval    startWriteTimeOfDay; /* Start of writeback. */
  55.     struct timeval    endTimeOfDay; /* End of recovery. */
  56.     int numLogSegments;   /* Number of segments in log. */
  57.     int    segSummaryFetch;  /* Number of segment summary blocks fetched per
  58.                * pass. */
  59.     int    segUsageBlocks; /* Number of segment usage blocks in log. */
  60.     int    descMapBlocks;  /* Number of desc map blocks in log. */
  61.     int descBlocks;    /* Number of desc blocks in log. */
  62.     int numDesc;    /* Number of desc in log. */
  63.     int numFileBlocks;    /* Number of file blocks. */
  64.     int numDirLogBlocks; /* Number of directory log blocks. */
  65.     int numDirLogEntries; /* Number of directory log entries. */
  66.     int    numDirLogDelete;  /* Number delete log records. */
  67.     int numDirLogDeleteOpen; /* Number delete while open log records. */
  68.     int numDirLogUnlink; /* Number unlink log records. */
  69.     int    numDirLogCreate; /* Number create log records. */
  70.     int numDirLogWithoutEnd; /* Number of directory log entries without end. */
  71.     int    dirLogBothForward; /* Both dir and inode forward. */
  72.     int dirLogDirBlockBackward; /* Dir block backward. */
  73.     int dirLogBothBackwardCreate; /* Both backward on a create. */
  74.     int dirLogBothBackward; /* Both backward on non-create. */
  75.     int descDelete;        /* Desc deleted. */
  76.     int descMove;        /* Desc moved. */
  77.     int filesToLostFound;   /* Files added to lost+found. */
  78.     int dirEntryAdded;        /* Directory entry added. */
  79.     int dirEntryRemoved;    /* Removed entry removed. */
  80.     int loadBlockReads;        /* Disk block reads during load. */
  81.     int pass1BlockReads;    /* Disk block reads during pass1. */
  82.     int pass2BlockReads;    /* Disk block reads during pass2. */
  83. } Stats;
  84.  
  85. extern Stats stats;
  86.  
  87. /*
  88.  * Start and end points of the tail of the recovery log.
  89.  */
  90. extern LogPoint    logStart;    /* Start of recovery log. */
  91. extern LogPoint    logEnd;        /* End of recovery log. */
  92.  
  93. /*
  94.  * Arguments.
  95.  */
  96. extern int    blockSize;    /* File system block size. */
  97. extern Boolean    verboseFlag;    /* Trace progress of program. */
  98. extern Boolean    showLog ;    /* Show contents of log being processed. */
  99. extern char    *deviceName;        /* Device to use. */
  100. extern Boolean recreateDirEntries; 
  101. extern Lfs    *lfsPtr;
  102.  
  103. /* procedures */
  104.  
  105. #endif /* _LFSRECOV */
  106.  
  107.